<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="../../vuejs/vue.js"></script>
<div id="app">
    <p>{{message}}</p>
    <button v-on:click="reverseMessage">反转</button>
    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                message: 'Hello Vue.js!',
            },
            methods: {
                reverseMessage: function () {
                    this.message = this.message.split("").reverse().join("");
                }

            }
        })
    </script>
</div>
</body>
</html>